package com.yyge.convertor;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyge.controller.articleType.req.ArticleTypeAddReq;
import com.yyge.controller.articleType.req.ArticleTypeEditReq;
import com.yyge.controller.articleType.req.ArticleTypeReq;
import com.yyge.controller.articleType.resp.ArticleTypeResp;
import com.yyge.entity.ArticleType;
import com.yyge.vo.PageVo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @program: js-hd
 * @description: 文章分类转换器
 * @author: gityyge
 * @create: 2024-01-25 09:54
 **/
@Mapper
public interface ArticleTypeConvertor {
    ArticleTypeConvertor MAPPER = Mappers.getMapper(ArticleTypeConvertor.class);

    //Req -> Entity
    ArticleType ob2en(ArticleTypeReq req);

    //AddReq -> Entity
    ArticleType ob2en(ArticleTypeAddReq req);

    //Edit -> Entity
    ArticleType ob2en(ArticleTypeEditReq req);

    ArticleTypeResp en2resp(ArticleType article);

    List<ArticleTypeResp> ob2respArr(List<ArticleType> list);
    PageVo<ArticleTypeResp> ob2respPage(Page<ArticleType> page);
}
